using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Reflection;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Storage;

using MegaEngine.Source.Tiles;
using MegaEngine.Source.Sprites;

namespace MegaEngine.Source.GameData.Metroid
{
    class MetroidLevelLoader : LevelLoader
    {
        public static ArrayList getEnvironment(String fileName, Texture2D[] spriteTextures)
        {
            char[] split = { ' ' };
            ArrayList environmentData = loadEnvironmentData(fileName);
            ArrayList result = new ArrayList();
            foreach (String data in environmentData)
            {
                Sprite add = new TetrisBrick();
                String[] dataTokens = data.Split(split);
                /*if (dataTokens[0].Equals("MyFirstXNAGame.Source.Sprites.Brick"))
                {
                    //do stuff...is it ever going to be a non-brick? not anytime soon...
                }*/
                add.texture = spriteTextures[int.Parse(dataTokens[1])];
                add.levelOrigin.X = int.Parse(dataTokens[2]);
                add.levelOrigin.Y = int.Parse(dataTokens[3]);
                add.color = Color.White;
                result.Add(add);
            }
            return result;
        }
    }
}
